package cn.liumouren.tool.security.autoconfigure;

import cn.liumouren.tool.security.core.DlFilter;
import cn.liumouren.tool.security.core.DlFilterRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author Daniel Liu
 * @date 2021/3/13 13:12
 */
@Configuration
public class DefaultAutoConfiguration {

    /**
     * 不管是否开启, 都要注入DlFilterRegistry
     */
    @Bean
    public DlFilterRegistry dlFilterRegistry(List<DlFilter> filters) {
        DlFilterRegistry registry = new DlFilterRegistry() {
        };
        registry.setFilters(filters);
        return registry;
    }

}
